package com.ithema.method1;

import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
        String usename="red";
        String password="qwee";
        Scanner sc=new Scanner(System.in);
        for (int i = 0; i <=3 ; i++) {
            System.out.println("请输入用户名：");
            String next = sc.next();
            System.out.println("请输入密码：");
            String next1 = sc.next();
            if(next.equals(usename)&&next1.equals(password)){
                System.out.println("登录成功！！");
            }else {
                if(i==3){
                    System.out.println("登录失败,你还剩"+(3-i)+"次,请明天再来登录！！");
                }else {
                System.out.println("登录失败,你还剩"+(3-i)+"次");
                }
            }

        }
    }
}
